home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / amos / AMOSList-0499.lzh / AMOSLIST / 000192_nobody_Fri Apr 23 18:45:57 1999.msg < prev    next >
Internet Message Format  |  1999-05-01  |  6KB

  1. Received: from onelist.com (pop.onelist.com [209.207.135.229])
  2.     by osf1.gmu.edu (8.8.8/8.8.8) with SMTP id SAA16865
  3.     for <mcox4@osf1.gmu.edu>; Fri, 23 Apr 1999 18:45:53 -0400 (EDT)
  4. Received: (qmail 1155 invoked by alias); 23 Apr 1999 22:21:25 -0000
  5. Received: (qmail 1109 invoked from network); 23 Apr 1999 22:21:23 -0000
  6. Received: from unknown (HELO mago.agonet.it) (195.32.124.10) by pop.onelist.com with SMTP; 23 Apr 1999 22:21:23 -0000
  7. Received: from agonet.it (ghizzo@p126079.agonet.it [195.32.126.79]) by mago.agonet.it (8.8.5/8.8.5) with SMTP id AAA12202 for <amos-list@onelist.com>; Sat, 24 Apr 1999 00:44:59 +0200
  8. From: Pietro Ghizzoni <ghizzo@agonet.it>
  9. To: amos-list@onelist.com
  10. Date: Sat, 24 Apr 1999 00:41:08 +0200
  11. Message-ID: <yam7783.426.1747096000@mail.agonet.it>
  12. In-Reply-To: <004d01be8d78$934f6b00$9a48a8c0@ki95142>
  13. X-Mailer: YAM 2.0Preview7 [020] - Amiga Mailer by Marcel Beck - http://www.yam.ch
  14. Organization: Dairymen Soft
  15. Mailing-List: list amos-list@onelist.com; contact amos-list-owner@onelist.com
  16. Delivered-To: mailing list amos-list@onelist.com
  17. Precedence: bulk
  18. List-Unsubscribe: <mailto:amos-list-unsubscribe@ONElist.com>
  19. Reply-to: amos-list@onelist.com
  20. Mime-Version: 1.0
  21. Content-Type: text/plain; charset=iso-8859-1
  22. Content-transfer-encoding: 8bit
  23. Subject: [amos-list] Re: A question on GUI extension & Gadtools
  24. Status: O
  25. X-Status: 
  26.  
  27. From: Pietro Ghizzoni <ghizzo@agonet.it>
  28.  
  29. Hello Declan
  30.  
  31. On 23-Apr-99, Declan Gorman wrote: [amos-list] Re: A question on GUI extension & Gadtools
  32.  
  33.  
  34. > Did I dream about it or do I remember correctly that GUI V2 incorporates
  35. > zones?
  36.  
  37. With the GUI V2 you can use the gadgets as zones. Anyway i like the idea,
  38. and so probably i'll add the zones support.
  39.  
  40. > The only trouble I am having with this is with incrementing the gadget
  41. > values relevant to the mouse position in real-time. So what I want to do
  42. > is detect if the mouse is over the gadget, if the mouse button is pressed
  43. > & held and relative to the mouse position to the centre of the gadget
  44. > increment/decrement the gadget value. The problem is that I cannot work
  45. > out how to increment the gadget value when the mouse button is held &
  46. > moved and stop when the mouse button is released.
  47. > Can anyone offer some assistance or theories how I may achieve this?
  48. > Anything would be appreciated.
  49.  
  50.  
  51. What are you doing????? :))
  52.  
  53. In order to detect if the mouse is over the gadget, you need the Gui
  54. Check() command. It checks the specified X and Y coordinates to see if a
  55. gadget exists. If a gadget does exist, the number of the gadget is
  56. returned, else -1 is reported.
  57.  
  58. But before we need to real-time monitor the mouse movements... and so Gui
  59. Mouse Report is the solution. 
  60.  
  61. This is the code: (i consider the window number 1 and the gadget 0)
  62.  
  63.  
  64.  
  65. Gui Open 1,1,20 : Gui Mouse Report 1,True
  66.  
  67. 'The Y Center of the gadaget...
  68. '------------------------------
  69. Y1=Gui Gad Height(1,0)/2+Gui Y Gad(1,0)
  70.  
  71.  
  72. Repeat 
  73.    
  74.    G=Gui Wait : X=Gui Mouse Ux : Y=Gui Mouse Uy
  75.    
  76.    If G=-11 : Rem Mouse click detected...
  77.       
  78.       GA=Gui Check(1,X,Y)
  79.       
  80.       If GA=0
  81.          INVISIBLE_SLIDER=1
  82.       Else 
  83.          INVISIBLE_SLIDER=0
  84.       End If 
  85.       
  86.    Else If G=-12 : Rem Mouse pointer moved..... 
  87.       
  88.       If INVISIBLE_SLIDER : Gui Set 1,0,0,Y1-Y : End If 
  89.       
  90.    End If 
  91.    
  92. Until G=-1
  93.  
  94. Gui Reset 
  95.  
  96.  
  97. This program doesn't work exactly as you want, because it's not possible to
  98. do it exactly as you want :) The only difference is the mouse key handling.
  99. When you click on the gadget, the invisible slider start moving..... when
  100. you click again somewhere it stop. I won't bother here, anyway due to a
  101. problem with gadtools in this case you can only partially check the mouse key press.
  102.  
  103.  
  104. About the mouse click events.. is important to specify this:
  105.  
  106. when the user click the mouse, you'll receive *two* -11 events. The first
  107. when the button is held, and the other when it's released. So you can easly
  108. monitor if the mouse button is clicked or not. But in this specific case,
  109. you *DON'T *receive the first -11 because you've clicked a gadget... you
  110. receive just one mouse event (-11)  when you release the key, hence you're
  111. not able to check the hold/release action.
  112.  
  113. Anyway the above program works nicely... i've tested it before this time :)
  114.  
  115.  
  116.  
  117. P.S Now i've revised the GUI V2 TCP/IP core.... for this reason you're
  118. waiting again! I'm sorry.. but i'm also working on *AmiGate* since AMOS needs a killer
  119. application... and the old tcp/ip core was not enough :)
  120.  
  121.  
  122.  
  123.  
  124.  
  125. --- 
  126.  
  127.  
  128. Bye!
  129.  
  130.  
  131.                                      !!!
  132.                                      o o
  133.    +-----------------------------oOO-(_)-OOo----------------------------+
  134.    |                                                                    |
  135.    |  Pietro Ghizzoni - Dairymen Soft              __  /// Amiga 12OO   |
  136.    |     E-Mail:  ghizzo@agonet.it                 \\\/// 'O3O  5OMhz   |
  137.    |           ICQ 16361472                         \/// 18MB - CD4x    |
  138.    |                                                                    |
  139.    | Amos Development Group Coordinator                 AMIGA RULEZ!    |
  140.    |                                                                    |
  141.    +--------------------------------------------------------------------+
  142.  
  143.  
  144. ------------------------------------------------------------------------
  145. Did you know that ONElist hosts some of the largest lists on the Internet?
  146. http://www.ONElist.com
  147. Our scaleable system is the most reliable free e-mail service on the Internet!
  148. ------------------------------------------------------------------------
  149. Official AMOS WWW: http://members.xoom.com/AmosFactory/front.html